<?php
/**
 * User: Peter Wang
 * Date: 17/3/16
 * Time: 下午2:53
 */

namespace App\Lib\Rpc;

use App\Lib\Support\Rpc;

class Admin
{

    /**
     * @param $email
     * @param $pwd
     * @return \App\Lib\Support\Rpc
     */
    public static function login($email, $pwd)
    {
        $postData = [];
        $postData['account'] = $email;
        $postData['passwd'] = $pwd;

        $rpcobj = Rpc::client()->get("/api/admin/login", $postData);

        return $rpcobj;
    }

    /**
     * @param $uid
     * @return \App\Lib\Support\Rpc
     */
    public static function getUserById($uid)
    {
        $postData = [];
        $postData['uid'] = $uid;

        $rpcobj = Rpc::client()->get("/api/admin/getUserById", $postData);

        return $rpcobj;
    }

    /**
     *  获取所有用户
     * 
     * @return \App\Lib\Support\Rpc
     */
    public static function getAllUser()
    {
        $rpcobj = Rpc::client()->get("/api/admin/getAllUser", []);

        return $rpcobj;
    }

}